#include "ws2812b_core.h"

void example_1(COLOR *buf, uint16_t buf_len, uint16_t *stept)
{
    uint16_t lstept = *stept;
    
    switch(lstept)
    {
        case 0 ... 10:
            for(uint8_t i=0; i<buf_len; i++)
                buf[i].r = lstept*10;
        break;
        
        case 11 ... 20:
            for(uint8_t i=0; i<buf_len; i++)
                buf[i].r = 200-lstept*10;
        break;
        
        case 21 ... 30:
            for(uint8_t i=0; i<buf_len; i++)
                buf[i].g = (lstept-20)*10;
        break;
        
        case 31 ... 40:
            for(uint8_t i=0; i<buf_len; i++)
                buf[i].g = 200-(lstept-20)*10;
        break;
        
        case 41 ... 50:
            for(uint8_t i=0; i<buf_len; i++)
                buf[i].b = (lstept-40)*10;
        break;
        
        case 51 ... 60:
            for(uint8_t i=0; i<buf_len; i++)
                buf[i].b = 200-(lstept-40)*10;
        break;
        
        default:
        break;
    }
        

    if(*stept < 60){
        (*stept)++;
    }
    else{
        (*stept)=0;
    }
}





















